package cn.lumin.mock.web;

import cn.lumin.mock.service.DataGenerationService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/mock")
public class MockController {

    @Resource
    private DataGenerationService dataGenerationService;


    @GetMapping("/generate-today-data")
    public String generateTodayData() {
        try {
            dataGenerationService.generateTodayData();
            return "当日数据生成成功！";
        } catch (Exception e) {
            return "数据生成失败：" + e.getMessage();
        }
    }
}
